<template>
	<view class="page">
		<view class="page-card">
			<view class="page-card-info">
				<view class="page-card-info-label">
					头像
				</view>
				<view class="page-card-info-value">
					<view class="avatar">
						<u-avatar :src="app_user_info.headImg"></u-avatar>
					</view>
					<!-- <u-icon name="arrow-right" color="#A6A6A6" size="14"></u-icon> -->
				</view>
			</view>
			<view class="page-card-info">
				<view class="page-card-info-label">
					姓名
				</view>
				<view class="page-card-info-value">
					{{app_user_info.userName}}
				</view>
			</view>
			<view class="page-card-info">
				<view class="page-card-info-label">
					身份
				</view>
				<view class="page-card-info-value">
					销售
				</view>
			</view>
			
			<view class="page-card-info" style="border: none;">
				<view class="page-card-info-label">
					仓库
				</view>
				<view class="page-card-info-value">
					{{app_user_info.warehouseName}}
				</view>
			</view>
		</view>
		<view class="page-btn" @click="handleLogin">退出登录</view>
	</view>
</template>

<script>
	import {loginOut} from '@/common/api/login.js'
	import constant from '@/constant/constant.js'
	
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			upload(){
				
			},
			handleLogin(){
				let jump_path = constant.StorageName.APP_LOGIN_PATH;
				uni.showModal({
					title: '提示',
					content: '确定要退出登录吗？',
					success: res => {
						if (res.confirm) {
							loginOut({
								tel:this.app_user_info.phone
							}).then(res=>{
								this.$store.commit('setUserInfo', {})
								uni.reLaunch({
									url:jump_path
								})
								
							})
						} else if (res.cancel) {
				
						}
					}
				});
			}
		}
	}
</script>

<style lang="less" scoped>
	page{
		width: 100%;
		padding: 20rpx;
		background-color: #f9f9f9;
	}
	.page{
		&-card{
			background: #FFFFFF;
			border-radius: 20rpx;
			padding: 0 30rpx;
			&-info{
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx 0;
				border-bottom: 1px solid #EDEDED;
				&-label{
					font-size: 28rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #000000;
				}
				&-value{
					display: flex;
					align-items: center;
					font-size: 28rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #888888;
					image{
						margin-right: 20rpx;
					}
				}
			}
		}
		&-btn{
			width: 88%;
			position: fixed;
			bottom: 80rpx;
			left: 50%;
			height: 80rpx;
			background: linear-gradient(180deg, #0085FF 0%, #98CEFF 100%);
			border-radius: 60rpx;
			text-align: center;
			line-height: 80rpx;
			font-size: 32rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			transform: translateX(-50%);
		}
	}
</style>
